package com.gitee.orderfegin.controller;

import com.gitee.bodboy.result.CommonResult;
import com.gitee.orderfegin.service.PaymentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName FeginController
 * @Description   feign 默认超时时间为1s
 * @Author xiongchao
 * @Date 2020/12/18 15:50
 **/
@RestController
public class FeginController {

    @Autowired
    private PaymentService service;

    @GetMapping("/consumer/getOne")
    public CommonResult getOne( Integer id){
        return CommonResult.ok(service.getById(id),200,"获取数据成功");
    }

    @GetMapping("/timeout")
    public CommonResult timeOut(){
        return CommonResult.ok(service.feignTimeout(),200,null);
    }
}
